package cg.studio.practise.interview;

public class Datatorrent
{
  /**
   * there are k sorted array, each array have N items.
   * merge them into one array.
   * the optimized solution should be k*N*logk.
   * 
   * Solution: Take advantage of sorted item, use heap to keep sorted items from different arrays 
   */
  
  /**
   * There have one stack and data
   * and did several operation on stack ( push and pop ), get the max value of current stack.
   * It's ok to use other stack but not other data structure.
   * the optimized solution is O(1)
   * 
   * Solution: use another stack to keep the information of max value to current size( of original stack )
   */
  
  /**
   * there are several nodes, when starting up, need to elect which node is the master node 
   * by only broadcasting message to other nodes.
   * this node will not receive response from other nodes.
   */
  
  /**
   * there are two sorted array A and B, one size is N, another is M
   * find the K smallest sums( A[i]+b[j] )
   */
  
  /**
   * check if a tree is balanced or not.
   * Optimize: keep the depth of sub tree
   */
  
  /**
   * find the minimal value of sorted but rotated array
   * for example  4, 5, 6, 7, 1, 2, 3
   *  
   * solution: pay attention to the case if the array is sorted but not rotated, this is a special case.
   */
  
  
}
